/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.agilelang.editor.listener;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import org.agilelang.editor.ViewFrame;
import org.agilelang.editor.dialog.DlgFile;
import org.agilelang.editor.dialog.DlgFile2;

/**
 *
 * @author RODERICK
 */
public class FileNewFile implements ActionListener {

    ViewFrame frame;

    public FileNewFile(ViewFrame frame) {
        this.frame = frame;
    }

    @Override
    public void actionPerformed(ActionEvent e) {
        DlgFile2 dialog = new DlgFile2(new javax.swing.JFrame(), true);
        dialog.setLocationRelativeTo(null);
        dialog.setVisible(true);
        if (dialog.isStatus()) {
            if (!dialog.getFileName().equals("")) {
                frame.newFile(dialog.getFileName(),dialog.getFileType());
            }
        }
    }
}
